<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page language="java" import="java.text.*"%>
<%@taglib uri="/struts-tags" prefix="s"%>

<%@ include file="/WEB-INF/include.inc.jsp" %>
<% String companyName = request.getParameter("companyName"); %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@include file="/WEB-INF/views/common/head.jsp"%>
<title>App用户登录详情</title>
<script> 
      var contextPath = '${contextPath}';
</script> 
<script type="text/javascript" src="${contextPath}/js/jquery.js"></script>
<script type="text/javascript" src="${contextPath}/js/main.js"></script> 
<script type="text/javascript" src="${contextPath}/js/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="${contextPath}/js/WdatePicker.js"></script>
<script>
layui.use(['laypage', 'layer'], function(){
	  var laypage = layui.laypage,
	      layer = layui.layer;
	  var nums = 4; //
	  var data = getData();
	  //模拟渲染
	 var render = function(curr){
	 var html ="", 
	     last = curr*nums - 1;
	     last = last >= data.length ? (data.length-1) : last;
	     for(var i = (curr*nums - nums); i <= last; i++){
	              	 html+="<tr>"	              	     
	              	      +"<th>"+data[i].Company+"</th>"
	              	      +"<th>"+data[i].Num+"人</th>"
	              	      +"</tr>";               
	              	    }
	              	    return html;
	             }
	  
	  //调用分页
	  laypage({
	    cont: 'demo8'
	    ,pages: Math.ceil(data.length/nums)  //得到总页数
	    ,jump: function(obj){
	      document.getElementById('itemTbody').innerHTML = render(obj.curr);
	    }
	  });
	    
	});
	function getData(){
		//var res = {};
		    //此处只是演示，实际场景通常是返回已经当前页已经分组好的数据
			  var contextPath = '${contextPath}';
			  var companyName='<%=companyName%>';
		         $.ajax({
		             type: "post",
		             url: contextPath+"/user_Index.action",
		             data: {
		             	companyName:companyName
		             },
		             async: false,
		             reultType:'json',
		             error: function (request) {
		                 alert("Connection error");
		             },
		             success: function (result) {
		                     res= JSON.parse(result);
		                     
		                      //var  html="订单总数:"+res.totalCount+"条,今日订单数:"+res.today+"条。";
		                      //$("#num").html(html);                
		             }
		         });
		         
		         return res.data;
		
	}
	
</script>
</head>
<body>
	<s:form id="domainForm" action="sysUser">
		<div class="main-content">
			<div class="breadcrumbs" id="breadcrumbs">
				<script type="text/javascript">
					try {
						ace.settings.check('breadcrumbs', 'fixed')
					} catch (e) {
					}
				</script>

				<ul class="breadcrumb">
					<li><i class="icon-home home-icon"></i> <a href="/main.action">主页</a>
					</li>

					<li><a href="#">App统计${num}</a></li>
					<li class="active">用户统计</li>
				</ul>
			</div>

			<div class="page-content">
				<div class="page-header">
                                                   局点选择:
                    <select name="company" id="company">
                                            <option value="1"><%=companyName%></option>
                                            <option value="2">全部</option>
                    </select>
                            
					开始时间：
					<input style="width: 110px;" name="txtdtStart"
									type="text"
									value="<%=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime())%>"
									id="txtdtStart" class="dfinput1 Wdate inputborder"
									onfocus="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;})"
									style="height: 23px; line-height: 23px; width: 85px;" />
					结束时间：
					<input style="width: 110px;" name="txtdtEnd" type="text"
									value="<%=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime())%>"
									id="txtdtEnd" class="dfinput1 Wdate inputborder"
									onfocus="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;})"
									style="height: 23px; line-height: 23px; width: 85px;" />
					

					<a class="btn btn-purple btn-sm" href="#" id="btnSearch">按时间查找</a>&nbsp;&nbsp;&nbsp;
					<!-- <a href="/sysUser_input.action" class="btn btn-purple btn-sm">添加</a> --> 
				    <a class="btn btn-purple btn-sm" href="#" id="btnSearchNew">查看新用户</a>
						<div>
							<div class="row">
								<div class="col-xs-12">
									<div class="row">
										<div class="col-xs-12">
											<div class="table-responsive">
												<table id="sample-table-1"
													class="table table-striped table-bordered table-hover">
													<thead>
														<tr>
															<th>局点名称</th>
															<th>注册人数</th>
														</tr>
													</thead>

													<tbody id="itemTbody">
													</tbody>
												</table>
											</div>
											<!-- /.table-responsive -->
										</div>
										<!-- /span -->
									</div>
									<!-- /row -->
									<div id="desc"></div>
									<div class="row" id="xx" style="display:none">
										<div class="col-xs-12">
											<div class="table-responsive">
                                            <table id="sample-table-2"
													class="table table-striped table-bordered table-hover">
													<thead>
														<tr>
															<th>姓名</th>
															<th>电话</th>
															<th>性别</th>
															<th>局点</th>
															<th>注册时间</th>
															<th>手机类型</th>
														</tr>
													</thead>

													<tbody id="itemTbody2">
													
													</tbody>
												</table>
											</div>
											<!-- /.table-responsive -->
										</div>
										<!-- /span -->
									</div>
									<!-- /row -->
									<div style="text-align:center" id="demo8"></div>

									<!-- /row -->


									<div class="hr hr-18 dotted hr-double"></div>
								</div>
							</div>
						</div> 
				</div>
			</div>
	</s:form>
	<div id="demo8"></div>
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel" style="color: red">错误提示</h4>
				</div>
				<div class="modal-body"></div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>